const TOKEN_KEY = 'geek-app-87'

// 获取 token
// const token = getToken()
// const getToken = () => {
//   return localStorage.getItem(TOKEN_KEY)
// }
const getToken = () => localStorage.getItem(TOKEN_KEY)

// 设置 token
const setToken = data => localStorage.setItem(TOKEN_KEY, JSON.stringify(data))

// 移除 token
const removeToken = () => localStorage.removeItem(TOKEN_KEY)

// 判断是否登录（授权）
const isAuth = () => !!getToken()

export { getToken, setToken, removeToken, isAuth }
